const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Boolean)
    playOnEnable  = true;

    onEnable(){
        if(this.playOnEnable)
        {
            this.node.getComponent(cc.Animation).play();
        }
    }

}
